package com.heitian.ssm.controller;

import com.heitian.ssm.model.Limit;
import com.heitian.ssm.service.LimitService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("/admin")
public class AdminController {
    private Logger log = Logger.getLogger(AdminController.class);

    @Resource
    private LimitService limitService;

    @RequestMapping("/show.do")
    public ModelAndView show(HttpServletRequest request, HttpSession session){
        //log.info("查询所有用户信息");
        List<Limit> list = limitService.getAll();

        ModelAndView mv = new ModelAndView();
        mv.setViewName("index");
        session.setAttribute("limitList",list);
        return mv;
    }
}
